<?php
namespace app\common\model\signreport;

use think\Model;

class Comment extends Model
{
    protected $table = 'comments';



    // 查询评论列表
    public function getList($id)
    {
        $list = $this->where('r_id', $id)->order('create_time desc')->select();
        return $list;
    }
    // 添加评论
    public function addComment($params)
    {
        $this->u_id = $params['u_id'];
        $this->r_id = $params['r_id'];
        $this->content = $params['content'];
        $this->imgs = $params['imgs'];
        $this->create_time = time();
        $this->save();
        return $rst = [
            'id' => $this->id,
        ];

    }
}
